namespace _5._19EmpireRecordsApp.Data.Migrations
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Migrations;
    using System.Linq;
    using _5._19EmpireRecordsApp.Data.Model;
    using _5._19EmpireRecordsApp.Data;

    internal sealed class Configuration : DbMigrationsConfiguration<_5._19EmpireRecordsApp.Data.ApplicationDbContext>
    {
        public Configuration()
        {
            AutomaticMigrationsEnabled = false;
        }

        protected override void Seed(_5._19EmpireRecordsApp.Data.ApplicationDbContext context)
        {
            //  This method will be called after migrating to the latest version.

            //  You can use the DbSet<T>.AddOrUpdate() helper extension method 
            //  to avoid creating duplicate seed data. E.g.
            //
            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
            //
            context.Album.AddOrUpdate(
                 a => a.ID,
                 new Album { ID = 1, AlbumName = "Licence to Ill", EPLP = EPLP.EP, Artist_AlbumID = 1  },
                 new Album { ID = 2, AlbumName = "Black Hole Sun", EPLP = EPLP.EP, Artist_AlbumID = 2 },
                     new Album { ID = 3, AlbumName = "Ok Computer", EPLP = EPLP.EP, Artist_AlbumID = 3 },
                     new Album { ID = 4, AlbumName = "Intergalactic", EPLP = EPLP.EP, Artist_AlbumID = 1}
                 );
            context.Artist.AddOrUpdate(
                b => b.id,
                new Artist { id = 1, ArtistName = "Beastie Boys", Genre = Genre.Rap, Artist_AlbumID = 1 },
                 new Artist { id = 2, ArtistName = "Soundgarden", Genre = Genre.Rap, Artist_AlbumID = 2 },
                  new Artist { id = 3, ArtistName = "Radiohead", Genre = Genre.Rap, Artist_AlbumID = 3 }
                );
        //    context.Album_Artist.AddOrUpdate(
          //      c => c.Id,
            //    new Artist_Album { Id = 1, ArtistID = 1, AlbumID = 1, },
              //   new Artist_Album { Id = 2, ArtistID = 1, AlbumID = 4},
                //  new Artist_Album { Id = 3, ArtistID = 2, AlbumID = 2},
              //    new Artist_Album { Id = 4, ArtistID = 3, AlbumID = 3}
               //   );
        }
    }
}
